<template>
	<view>
		<view>登录</view>
		<view>
			用户名：<input v-model="user.name"/>
		</view>
		<view>
			密码：<input v-model="user.password"/>
		</view>
		<button type="primary" @click="userStore.login(user)">登录</button>
		
		<navigator url="./home">首页</navigator>
	</view>
</template>
<script setup>
	// 导入仓库
	import {useUserStore} from '@/stores/useUserStore.js'
	// 导入响应方法
	import {reactive} from 'vue'
	const user = reactive({name:'',password:''})
	// 定义仓库
	const userStore = useUserStore();
	
</script>